package com.hundsun.cprs.yyt.service.trade.enums;

import java.util.HashMap;
import java.util.Map;

public enum EnumEntustRollbackStatus {

    COMMITED(1, "已提交"),

    SUCCESS(2, "成功"),
    
    FAIL(3,"失败");

    EnumEntustRollbackStatus(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    private Integer code;

    private String  desc;

    /**
     * 全局索引池
     */
    private static Map<Integer, EnumEntustRollbackStatus> pool = new HashMap<Integer, EnumEntustRollbackStatus>();
    static {
        for (EnumEntustRollbackStatus et : EnumEntustRollbackStatus.values()) {
            pool.put(et.code, et);
        }
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static Map<Integer, EnumEntustRollbackStatus> toMap() {
        return pool;
    }
}
